package com.credithc.eagleeye.console.vo;
import com.credithc.eagleeye.util.FastJsonConvert;
import lombok.Data;
import lombok.Getter;
import lombok.Setter;

import java.util.ArrayList;
import java.util.List;
/**
 * 描 述: <br/>
 * 作 者: zhangjin<br/>
 * 创 建：2018年10月26日<br/>
 * 版 本：v1.0.0<br>
 * <p>
 * 历 史: (版本) 作者 时间 注释 <br/>
 */
@Data
public class StatSunburstVo {
    private String name;
    private long value;
    private long okCount;
    private long errorCount;
    private ItemStyleBean itemStyle;
    private List<StatSunburstVo> children = new ArrayList<>();

    public static class ItemStyleBean {
        @Getter
        @Setter
        private String color;
    }
    public StatSunburstVo() {
    }
    public StatSunburstVo(String name) {
        this.name = name;
        this.itemStyle = new ItemStyleBean();

    }
    public StatSunburstVo(String name,String color) {
        this.name = name;
        ItemStyleBean itemStyle = new ItemStyleBean();
        itemStyle.setColor(color);
        this.itemStyle = itemStyle;
    }

    public static void main(String[] args) {
        StatSunburstVo vo = new StatSunburstVo();
        vo.setItemStyle(new ItemStyleBean());
        ArrayList<StatSunburstVo> childrenList = new ArrayList<>();
        childrenList.add(new StatSunburstVo());
        vo.setChildren(childrenList);
        System.out.println(FastJsonConvert.convertObjectToJSONWithNullValue(vo));
    }
}
